#include <iostream>
#include <memory>
#include <ctime>
#include "ThreadPool.hpp"
#include "Task.hpp"


int main()
{
    std::unique_ptr<ThreadPool<Task> > tp(new ThreadPool<Task>());
    tp->Start();
    
   
    srand((uint64_t)time(nullptr) ^ getpid());
    while(true)
    {

        //可以搞一个网络任务
        int x = rand() % 100 + 1;
        usleep(1234);
        int y = rand() % 200;
        usleep(1234);
        char oper = opers[rand() % opers.size()];
        Task t(x, y, oper);
        // std::cout << "make task: " << t.PrintTask() << std::endl;

        tp->Push(t);
        sleep(1);
    }

    tp->Wait();


    
    return 0;
}